package subject_set.offer100;

/**
 * @author haomin
 * @date 2022/10/13 21:31
 **/
public class Offer11 {
    class Solution {
        public int minArray(int[] numbers) {
            int l = 0, r = numbers.length - 1, mid;
            while(l <= r) {
                mid = l + ((r-l) >> 1);
                if(numbers[mid] < numbers[r]) {
                    r = mid;
                }else if(numbers[mid] > numbers[r]) {
                    l = mid + 1;
                }else r--;
            }
            return numbers[l];
        }
    }
}